import Carousel from './components/Carousel';
import CarItem from './components/Carousel/Item';

import TreeMenu from './components/TreeMenu';
import MenuItem from './components/TreeMenu/MenuItem';
import SubMenu from './components/TreeMenu/SubMenu';
import ReSubMenu from './components/TreeMenu/ReSubMenu';

import Selector from './components/Selector';

import Modal from './components/Modal';

import Magnifier from './components/Magnifier';

import Stars from './components/Stars';

import './resets.css';
import './assets/css/iconfont.css';

const MyUI = {};
const componentPool = [
  Carousel,
  CarItem,
  TreeMenu,
  MenuItem,
  SubMenu,
  ReSubMenu,
  Selector,
  Modal,
  Magnifier,
  Stars
]

MyUI.install = (Vue, options) => {
  if (options && options.components) {
    const component = options.components;

    component.map(compName => {
      componentPool.map(c => {
        if (compName === c.name) {
          app.component(c.name, c);
        }
      })
    })

  } else {
    componentPool.map(c => {
      Vue.component(c.name, c);
    })
  }
}

export default MyUI;